﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Jc.MicroDesigner.Management;

namespace Jc.MicroDesigner.ToolWindows
{
    /// <summary>
    /// Окно свойств схемы
    /// </summary>
    public partial class SchemePropertiesForm : Form
    {
        ObjectManager _Manager = null;

        /// <summary>
        /// Создать редактор свойств
        /// </summary>
        public SchemePropertiesForm()
        {
            InitializeComponent();
        }

        public void ShowDialog(ObjectManager Manager)
        {
            _Manager = Manager;
            NameTxtBox.Text = Manager.SchemeName;
            AuthorTxtBox.Text = Manager.Author;
            DescrTxtBox.Text = Manager.Description;
            ShowDialog();
        }

        private void OkBtn_Click(object sender, EventArgs e)
        {
            _Manager.SchemeName = NameTxtBox.Text ;
            _Manager.Author = AuthorTxtBox.Text;
            _Manager.Description = DescrTxtBox.Text;
        }
    }
}